#ifndef CG07_GRABBER
#define CG07_GRABBER

#include <string>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <GL/glut.h>
#include <sstream>



class Grabber 
{
private:
	// Fields 
	float  trX, trY, trZ, rotX, rotY, rotZ;
	float  trChunk, rotChunk;
	int direction;
	char keyDown[256];
	int lastX,lastY,state,button;
	
	boost::numeric::ublas::vector<float> center;
	boost::numeric::ublas::vector<float> eye;
	boost::numeric::ublas::vector<float> up;

	// helper functions
	void printStatus();
	void reset();
	void rotate();
	void translate();

public:
	Grabber();
	~Grabber();
	
	void handleKeyDown(unsigned char key,int,int);
	void handleKeyUp(unsigned char key,int,int);
	void handleSpecialKey(int key, int mod);
	void handleMouse(int button, int state,int x, int y);
	void handleMouseMotion(int x,int y);
	void update();
	void transform();
	std::string toString();
};


#endif
